package org.liaohailong.library.db.builder

import android.content.ContentValues
import org.liaohailong.library.db.model.ColumnInfo


/**
 * Author: liaohailong
 * Date: 2019/4/3
 * Time: 3:54 PM
 * Description: SQL语句
 **/
interface SQLHelper {
    companion object {
        const val TEXT = "TEXT"
        const val REAL = "REAL"
        const val INTEGER = "INTEGER"
        const val LONG = "LONG"
    }

    fun setDataBaseName(dbName: String)

    fun getDataBaseName(): String

    fun setTable(table: Class<*>)

    fun getTable(): String

    fun getPrimaryKey(): String

    fun setSelectColumns(distinct: List<String>)

    fun getSelectColumns(): List<String>?

    fun getAllColumns(): List<ColumnInfo>

    fun saveItem(table: Any)

    fun putUpdateParam(key: String, value: Any)

    fun putWhereParam(key: String, value: Any)

    fun putOrder(name: String)

    fun putLimit(limit: Int, offset: Int)

    fun getCreateTableIfNotExistsSQL(): String

    fun checkTableIfExistSQL(): String

    fun getRenameTableToTempSQL(tempTableName: String): String

    fun getTransferTableSQL(columns: List<String>, tempTableName: String): String

    fun getDropTableSQL(table: String): String

    fun <T> getMultipleInsertSQL(insert: MutableList<T>): String

    fun getContentValues(): ContentValues?

    fun getWhereClause(): String

    fun getWhereArgs(): Array<String>

    fun getOrderBy(orderBy: String): String?

    fun getLimit(): String?

    fun reset()
}